package com.ls.pattern.structure.decorator;

import com.ls.pattern.structure.decorator.model.Drink;

public class Decorator extends Drink {
    private Drink coffee;

    public Decorator(Drink coffee) {
        this.coffee = coffee;
    }

    @Override
    public float cost() {
        //super.getPrice()自己的价格
        return super.getPrice() + coffee.cost();
    }

    @Override
    public String getDes() {
        return super.getDes() + "" + super.getPrice() + " && " + coffee.getDes();
    }


}
